package com.gitee.feizns.quickstart.spring.data.jpa.autoconfigure;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.env.EnvironmentPostProcessor;
import org.springframework.core.env.ConfigurableEnvironment;
import org.springframework.core.env.PropertiesPropertySource;

import java.util.Properties;

/**
 * @author feizns
 * @since 2025/1/3
 */
public class SpringDataJpaDefaultAutoConfigure implements EnvironmentPostProcessor {

    @Override
    public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
        Properties properties = new Properties();
        properties.put("spring.jpa.hibernate.ddl-auto", "update");
        environment.getPropertySources().addLast(new PropertiesPropertySource("quickstart-spring-data-jpa", properties));
    }

}
